{% extends "./inc/base.html" %} {% block content %}

<section class="vbox">
    <header class="header bg-light dk">
        <p>{{controller.meta_title}}</p>
    </header>
    <section class="scrollable wrapper">   
  <section class="panel panel-default">
            <header class="panel-heading">
               {{controller.meta_title}}
            </header>
      <div class="row wrapper">

          <div class="col-sm-9 m-b-xs">
              <div class="">
                  <a class="btn btn-sm btn-info " href="/admin/ecom/addprofit" data-toggle="ajaxModal">
                      新增
                  </a>

                  <a class="btn btn-sm btn-info ajax-post confirm" href="/admin/ecom/delprofit" target-form="ids">
                      删除
                  </a>
              </div>
          </div>
          <div class="col-sm-3">
              <div class="input-group pull-right">
                  <input type="text" class="input-sm form-control" placeholder="Search">
                      <span class="input-group-btn">
                        <button class="btn btn-sm btn-default" type="button">查询</button>
                      </span>
              </div>
          </div>
      </div>
            <div class="table-responsive">
                <table class="table table-striped b-t b-light" id="export-form">
                    <thead>
                    <tr>
                        <th style="width:20px;"><label class="checkbox m-n i-checks"><input type="checkbox"><i></i></label></th>
                        <th style="width:40px">ID</th>
                        <!-- 
                        <th>用户ID</th>
                         -->
                        <th>代理ID</th>
                        <th>金额</th>
                        <th>余额</th>
                        <th>类型</th>
                        <th>状态</th>
                        <th>分润时间</th>
                        <th>结算时间</th>
                        <th>说明</th>
                        <th style="width:130px;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for item in list %}
                    <tr>
                        <td><label class="checkbox m-n i-checks"><input class="ids" type="checkbox" name="ids" value="{{item.id}}"><i></i></label></td>
                        <td style="width:40px">{{item.id}}</td>
                         <!--
                        <td>{{item.user_id}}</td>
                         -->
                        <td>{{item.proxy_id}}</td>
                        <td>{%if item.amount %}{{item.amount|formatCurrency}}{%else%}0.00{%endif%}</td>
                        <td>{%if item.amount_log %}{{item.amount_log|formatCurrency}}{%else%}0.00{%endif%}</td>
                        <!-- 
                        0:订单充卡，1:订单充币,2:消耗房卡,3:消耗金币
                         -->
                        <td>{%if item.type ==0%}
                                                                                      订单充卡
                            {%elif item.type == 1 %}
                                                                                      订单充币
                            {%elif item.type == 2 %}
                                                                                      消耗房卡
                            {%elif item.type == 3 %}
                                                                                      消耗金币
                            {%endif%}
                        </td>
                        <td>{%if item.status == 0%}
                                                                                      未结算
                            {%elif item.status == 1 %}
                                                                                      已结算
                            {%endif%}
                        </td>
                        <td>{{item.create_time|moment("YYYY-MM-DD HH:mm:ss")}}</td>
                        <td>
                        {%if item.settle_time%}
                        {{item.settle_time|moment("YYYY-MM-DD HH:mm:ss")}}
                        {%endif%}
                        </td>
                        <td>
                        <!-- 
                        {{item.note}}
                         -->
                         </td>
                        <td>
                            <a href="/admin/ecom/editprofit/?id={{item.id}}" class="text-info" data-toggle="ajaxModal">编辑</a>
                            <a href="/admin/ecom/delprofit/?ids={{item.id}}" class="confirm ajax-get text-info">删除</a></td>
                       </tr>
                    {% else %}
                    <tr><td colspan="7"><div class="alert alert-warning alert-block">
                        <button data-dismiss="alert" class="close" type="button">×</button>
                        <p>This would display if the 'item' collection were empty</p>
                    </div></td></tr>

                    {% endfor %}

                    </tbody>
                </table>
            </div>
            <footer class="panel-footer">
                <div class="row">


                    <div class="col-sm-12 text-right text-center-xs">
                        {{pagerData | safe}}
                    </div>
                </div>
            </footer>
        </section>
    </section>
</section>

{% endblock %}
{% block script%}
<script src="/static/admin/js/parsley/parsley.min.js"></script>
<script src="/static/admin/js/parsley/parsley.extend.js"></script>
{% endblock %}